import MainContainerCustom from '@/components/MainContainerCustom';
import { Button } from '@antmjs/vantui';
import Taro from '@tarojs/taro';
import { CSelectCustom } from '@vh-mobile/pro-components';
import { eventsBus } from '@vh-mobile/pro-utils';

export default function DemoSelect() {
  const eventName: any = 'CSelectCustom1';

  const onClick = () => {
    console.log(Taro);
    eventsBus.$pageTrigger(eventName, {
      options: [
        {
          value: 1,
          label: '选择选择选择选择选择选择选择选择选择选择Select1Select1Select1',
        },
        {
          value: 2,
          label: 'Select2',
        },
        {
          value: 3,
          label: '3',
        },
        {
          value: 4,
          label: '4',
        },
        {
          value: 5,
          label: '5',
        },
        {
          value: 6,
          label: '选择选择选择选择选择选择选择选择选择选择Select1Select1Select17',
        },
      ],
    });
  };

  // console.log(loadData);

  return (
    <MainContainerCustom>
      <Button onClick={onClick} type="primary" block={true}>
        点击选择
      </Button>
      {/* //如果有公用的可以直接调用不需要引入组件 */}
      <CSelectCustom
        value={1}
        onChange={() => {}}
        options={[
          {
            value: 1,
            label: 'Select1',
          },
          {
            value: 2,
            label: 'Select2',
          },
        ]}
        eventName={eventName}
      />
    </MainContainerCustom>
  );
}
